<%--
  Created by IntelliJ IDEA.
  User: edz
  Date: 2021/4/15
  Time: 16:49
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>首页</title>
    <script src="../views/js/jquery.js"></script>
</head>
<body>
    <table id="UserInfo" border="1">
        <tr>
            <th>ID</th>
            <th>人脸识别码</th>
            <th>用户姓名</th>
            <th>首次录入城市</th>
            <th>录入的次数</th>
            <th>上次进店时间</th>
        </tr>
    </table>
</body>
<script>
    $(function () {
        $.ajax({
            url:"http://localhost:8080/user",
            type:"post",
            dataType:"json",
            success:function (data) {
                $.each(data.object,function (i,o) {
                    var userInfo = "<tr><td>"+ o.id +"</td>";
                    userInfo += "<td>"+ o.faceId +"</td>";
                    userInfo += "<td>"+ o.userName +"</td>";
                    userInfo += "<td>"+ o.city +"</td>";
                    userInfo += "<td>"+ o.count +"</td>";
                    userInfo += "<td>"+ o.logintme +"</td></tr>";
                    $("#UserInfo").append(userInfo);
                })
            }
            ,error:function () {

            }
        })
    })
</script>
</html>
